/**
 * Copyright &copy; 2015-2020 <a href="http://www.jeeplus.org/">JeePlus</a> All rights reserved.
 */
package com.jeeplus.modules.orders.entity;

import com.jeeplus.modules.member.entity.Member;
import javax.validation.constraints.NotNull;
import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.jeeplus.modules.goods.entity.Goods;

import com.jeeplus.core.persistence.DataEntity;
import com.jeeplus.common.utils.excel.annotation.ExcelField;

/**
 * 交易订单Entity
 * @author freedom
 * @version 2020-09-26
 */
public class Orders extends DataEntity<Orders> {
	
	private static final long serialVersionUID = 1L;
	private String ordersNo;		// 订单编号
	private Member member;		// 出售用户
	private Member tomem;		// 购买用户
	private Double money;		// 购买价格
	private Date paytime;		// 支付时间
	private String ordersStatus;		// 订单状态
	private String img;		// 打款凭证
	private String payType;		// 收款方式
	private String accountName;		// 账户名称
	private String accountNo;		// 账户账号
	private Goods goods;		// 商品
	private String addressName;		// 收货人
	private String addressAdd;		// 收货地址
	private String addressMobile;		// 收货人电话
	private String isSale;			//订单是否已托管出售（0已托管出售）

	//前端用商品图片
	private String goodsPic;
	//前端用商品价格
	private Double goodPrice;
	//前端用利润
	private Double profitPrice;

	private String goodsType;

	private Double goodsPrice;

	private String memPhone;   // 前端列表用出售、购买人手机号

	private String placeDate;

	public Orders() {
		super();
	}

	public Orders(String id){
		super(id);
	}

	@ExcelField(title="订单编号", align=2, sort=1)
	public String getOrdersNo() {
		return ordersNo;
	}

	public void setOrdersNo(String ordersNo) {
		this.ordersNo = ordersNo;
	}
	
	@ExcelField(title="出售用户", fieldType=Member.class, value="member.loginName", align=2, sort=2)
	public Member getMember() {
		return member;
	}

	public void setMember(Member member) {
		this.member = member;
	}
	
	@ExcelField(title="购买用户", fieldType=Member.class, value="tomem.loginName", align=2, sort=3)
	public Member getTomem() {
		return tomem;
	}

	public void setTomem(Member tomem) {
		this.tomem = tomem;
	}
	
	@NotNull(message="购买价格不能为空")
	@ExcelField(title="购买价格", align=2, sort=4)
	public Double getMoney() {
		return money;
	}

	public void setMoney(Double money) {
		this.money = money;
	}
	
	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
	@ExcelField(title="支付时间", align=2, sort=5)
	public Date getPaytime() {
		return paytime;
	}

	public void setPaytime(Date paytime) {
		this.paytime = paytime;
	}
	
	@ExcelField(title="订单状态", dictType="ordersStatus", align=2, sort=6)
	public String getOrdersStatus() {
		return ordersStatus;
	}

	public void setOrdersStatus(String ordersStatus) {
		this.ordersStatus = ordersStatus;
	}
	
	@ExcelField(title="打款凭证", align=2, sort=7)
	public String getImg() {
		return img;
	}

	public void setImg(String img) {
		this.img = img;
	}
	
	@ExcelField(title="收款方式", dictType="payType", align=2, sort=8)
	public String getPayType() {
		return payType;
	}

	public void setPayType(String payType) {
		this.payType = payType;
	}
	
	@ExcelField(title="账户名称", align=2, sort=9)
	public String getAccountName() {
		return accountName;
	}

	public void setAccountName(String accountName) {
		this.accountName = accountName;
	}
	
	@ExcelField(title="账户账号", align=2, sort=10)
	public String getAccountNo() {
		return accountNo;
	}

	public void setAccountNo(String accountNo) {
		this.accountNo = accountNo;
	}
	
	@ExcelField(title="商品", fieldType=Goods.class, value="goods.name", align=2, sort=11)
	public Goods getGoods() {
		return goods;
	}

	public void setGoods(Goods goods) {
		this.goods = goods;
	}
	
	@ExcelField(title="收货人", align=2, sort=12)
	public String getAddressName() {
		return addressName;
	}

	public void setAddressName(String addressName) {
		this.addressName = addressName;
	}
	
	@ExcelField(title="收货地址", align=2, sort=13)
	public String getAddressAdd() {
		return addressAdd;
	}

	public void setAddressAdd(String addressAdd) {
		this.addressAdd = addressAdd;
	}
	
	@ExcelField(title="收货人电话", align=2, sort=14)
	public String getAddressMobile() {
		return addressMobile;
	}

	public void setAddressMobile(String addressMobile) {
		this.addressMobile = addressMobile;
	}

	public String getIsSale() {
		return isSale;
	}

	public void setIsSale(String isSale) {
		this.isSale = isSale;
	}

	public String getGoodsPic() {
		return goodsPic;
	}

	public void setGoodsPic(String goodsPic) {
		this.goodsPic = goodsPic;
	}

	public Double getGoodPrice() {
		return goodPrice;
	}

	public void setGoodPrice(Double goodPrice) {
		this.goodPrice = goodPrice;
	}

	public Double getProfitPrice() {
		return profitPrice;
	}

	public void setProfitPrice(Double profitPrice) {
		this.profitPrice = profitPrice;
	}

	public String getGoodsType() {
		return goodsType;
	}

	public void setGoodsType(String goodsType) {
		this.goodsType = goodsType;
	}

	public String getMemPhone() {
		return memPhone;
	}

	public void setMemPhone(String memPhone) {
		this.memPhone = memPhone;
	}

	public Double getGoodsPrice() {
		return goodsPrice;
	}

	public void setGoodsPrice(Double goodsPrice) {
		this.goodsPrice = goodsPrice;
	}

	public String getPlaceDate() {
		return placeDate;
	}

	public void setPlaceDate(String placeDate) {
		this.placeDate = placeDate;
	}
}